-
Notifications
You must be signed in to change notification settings - Fork 0
MediaSend update 1 : Moved fragment UI to compose #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: improvements/mediasend-compose
Are you sure you want to change the base?
Conversation
| ) { | ||
|
|
||
| // span logic: screenWidth / media_picker_folder_width | ||
| val folderWidth = dimensionResource(R.dimen.media_picker_folder_width) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the dp value in this file to keep our Dimension.kt values generic.
| modifier = Modifier | ||
| .align(Alignment.BottomCenter) | ||
| .fillMaxWidth() | ||
| .height(50.dp) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| @Deprecated |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| .clickable(onClick = onClick) | ||
| ) { | ||
| Box(modifier = Modifier.aspectRatio(1f)) { | ||
| GlideImage( |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| modifier = Modifier.fillMaxSize(), | ||
| contentScale = ContentScale.Crop | ||
| ) | ||
| // Bottom shade overlay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it could be achieved more easily with the innerShadow modifier?
| selected.indexOfFirst { it.uri == media.uri } | ||
| } | ||
|
|
||
| // Matches adapter rules: |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| .padding(end = 2.dp, bottom = 2.dp) | ||
| .aspectRatio(1f) | ||
| .combinedClickable( | ||
| onClick = { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
| Box( | ||
| modifier = modifier | ||
| .padding(end = 2.dp, bottom = 2.dp) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| ) | ||
|
|
||
| // Border overlay (replaces @drawable/mediapicker_item_border_dark View) | ||
| Box( |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| painter = painterResource(R.drawable.triangle_right), | ||
| contentDescription = null, | ||
| modifier = Modifier | ||
| .size(width = 15.dp, height = 18.dp) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
| val context = LocalContext.current | ||
| val activity = context as? FragmentActivity | ||
| val showManage = remember(activity) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved a few functions into the VM and added the flag to the UiState as an initial change. Maybe we can separate permission checking from the AttachmentManager. I copied some of the permission checks into the VM for now but I can do the separate file if we find that suitable for the modern structure.
| .fillMaxSize() | ||
| .background(LocalColors.current.background) | ||
| ) { | ||
| items(folders) { folder -> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| val mediaItemGridSpacing : Dp = 2.dp, | ||
| val mediaPlayOverlay : Dp = 36.dp, | ||
|
|
||
| val smallRadius : Dp = 26.dp |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| .padding(LocalDimensions.current.xxsSpacing), | ||
| contentAlignment = Alignment.Center | ||
| ) { | ||
| IndicatorOn(size = LocalDimensions.current.smallRadius) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.Dp | ||
| import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi | ||
| import com.bumptech.glide.integration.compose.GlideImage |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| .aspectRatio(1f) | ||
| .border( | ||
| width = LocalDimensions.current.borderStroke, | ||
| color = Color.White.copy(alpha = 0.20f) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Moved the old Fragment XMLs to Compose.
New ComposeFragments are created to replace the old fragments for the MediaSendActivity.
Part 2 in progress : MediaSendFragment UI to compose.